package com.dobbinsoft.iotechn.device.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dobbinsoft.iotechn.core.model.Page;
import com.dobbinsoft.iotechn.data.mapper.IMapper;
import com.dobbinsoft.iotechn.device.domain.DeviceDO;
import com.dobbinsoft.iotechn.device.dto.DeviceDevDTO;
import org.apache.ibatis.annotations.Param;

/**
 * Description:
 * User: rize
 * Date: 2020/6/17
 * Time: 15:01
 */
public interface DeviceMapper extends IMapper<DeviceDO> {

    public Page<DeviceDevDTO> getDevicePage(IPage<DeviceDevDTO> page, @Param("productId") Long productId, @Param("accessKeyId") String accessKeyId, @Param("developerId") Long developerId);

    public Integer onlineDevice(@Param("deviceId") Long deviceId, @Param("code") Integer code);

    public Integer offlineDeviceByAccessKeyId(@Param("accessKeyId") String accessKeyId, @Param("code") Integer code);

    public DeviceDO getDeviceUserIdForUpdate(@Param("accessKeyId") String accessKeyId);

}
